package com.shg.web.ztest;



import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.shg.bean.Admin;
import com.shg.service.AdminService;

public class AdminServiceTest {

	static AdminService adminService;
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		ApplicationContext context=new ClassPathXmlApplicationContext("basics-application.xml");
		adminService=(AdminService) context.getBean("adminServiceBean");
	}

	@Test
	public void testInsert() {
		Admin entity=new Admin();
		entity.setName("赵七");
		entity.setPassWord("123456");
		entity.setPhone("15994417552");
		entity.setEmail("941376006@QQ.com");
		
//		Roles roles=new Roles();
//		roles.setId(83);
//		
//		entity.setRole(roles);
		adminService.insert(entity);
	}
	
	@Test
	public void testGetLogin(){
		Admin admin=new Admin();
		admin.setName("张三");
		admin.setPassWord("123456");
	}

	
}
